import { post,get } from "./http";
import { ResponseType } from "./utils/utils";
import apiUrl from './apiUrl'
// 公告
export function getcolumnarticel() {
    return get<ResponseType>(apiUrl.columnarticel);
}
// 获取订单列表getPageList
export function getPageList(data?:any) {
  return get<ResponseType>(apiUrl.getPageList,data);
}
// 取消订单/hd/orderApi/cancelOrder
export function cancelOrder(id:string) {
  return get<ResponseType>(apiUrl.cancelOrder+"/"+id);
}
// 获取收藏记录
export function getCollectList(data?:any) {
  return get<ResponseType>(apiUrl.collectList,data);
}
// 查询已申请列表/hd/InvoiceApi/getOrderInvoiceList
export function getOrderInvoiceList(data?:any) {
  return get<ResponseType>(apiUrl.getOrderInvoiceList,data);
}
// invoicelist: '/hd/InvoiceApi/invoice/list', //开票抬头列表
export function getinvoicelist(data?:any) {
  return get<ResponseType>(apiUrl.invoiceList,data);
}
// 开票申请
export function getApplyInvoice(data?:any) {
  return post<ResponseType>(apiUrl.applyInvoice,data);
}
// invoiceadd: '/hd/InvoiceApi/invoice/add',//添加发票抬头
//   invoiceupdate:'/hd/InvoiceApi/invoice/update',//修改发票抬头
export function invoiceadd(data?:any) {
  return post<ResponseType>(apiUrl.invoiceadd,data);
}
export function invoiceupdate(data?:any) {
  return post<ResponseType>(apiUrl.invoiceupdate,data);
}
// 删除发票头
export function removeInvoice(id:string) {
  return get<ResponseType>(apiUrl.removeInvoice+"/"+id);
}

// 下载素材downloadDetail
export function downloadDetail(detailId:number,priceId:number,machineCode:string) {
  return get<any>(apiUrl.downloadDetail,{detailId:detailId,priceId:priceId,machineCode:machineCode});
}

// getCarts购物车列表
export function getCarts() {
  return get<ResponseType>(apiUrl.getCarts);
}
// removeCarts 删除购物车
export function removeCarts(id:string) {
  return get<ResponseType>(apiUrl.removeCarts,{ids:id});
}
// saveCart 添加购物车
export function saveCart(data:any) {
  return post<ResponseType>(apiUrl.saveCart,data);
}
// 提交订单 subOrder
export function subOrder(data:any) {
  return post<ResponseType>(apiUrl.subOrder,data);
}
// 生成二维码notifyOrderCmb
export function notifyOrderCmb(id:number) {
  return post<ResponseType>(apiUrl.notifyOrderCmb+'/'+id);
}
// 检查支付状态checkIspay
export function checkIspay(id:string) {
  return get<ResponseType>(apiUrl.checkIspay+id);
}
// 查询机器码
export function machineList(data:any) {
  return get<ResponseType>(apiUrl.machineList,data);
}
// machineAdd新增 machineDel删除
export function machineAdd(machineCode:string,name:string) {
  return post<ResponseType>(apiUrl.machineAdd,{machineCode:machineCode,name:name});
}
export function machineDel(id:string) {
  return get<ResponseType>(apiUrl.machineDel+"/"+id);
}